<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="View.*" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<link rel="stylesheet" type="text/css" href="css/index.css" />
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>ToWa Web shop</title>
</head>
<body>
	<div id="container">
		<jsp:include page="header.jsp" />
		<jsp:include page="menu.jsp" />
		<div id="content">
			<%
			ArrayList<CategoryView> subCategory = (ArrayList<CategoryView>) request.getAttribute("content");
			if (subCategory.size() > 0) {
			%>
				<b>Menyer:</b><br/>
			<%
				for (int i = 0; i < subCategory.size(); i++) {
					%>
					<a href="/webshop/items<%=request.getAttribute("parentPath")%><%=subCategory.get(i).getName()%>/"><%=subCategory.get(i).getName()%></a><br/>
					<%
				}
			}
			ArrayList<ItemView> items = (ArrayList<ItemView>) request.getAttribute("items");
			if(items.size() > 0) {
			%>
				<b>Items:</b><br/>
			<% 
				for (int i = 0; i < items.size(); i++) {
					%>
					<a href="/webshop/item?id=<%=items.get(i).getItemId()%>"><%=items.get(i).getName() %></a><br/>
					<% 
				}
			}
			%>
			
		</div>
		<jsp:include page="shoppingcart.jsp" />
		<jsp:include page="footer.jsp" />
	</div>
</body>
</html>